package com.woniu.pojo;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * user
 * @author 
 */
public class User implements Serializable {
    private Integer uid;
    @NotBlank(message = "uname 不能为空")
    private String uname;
    @Size(max = 6,min = 3,message = "upwd 应该在3-6位")
    private String upwd;

    private String uaccount;

    private String uemail;

    private String softdel;

    private static final long serialVersionUID = 1L;

    public Integer getUid() {
        return uid;
    }

    public void setUid(Integer uid) {
        this.uid = uid;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getUpwd() {
        return upwd;
    }

    public void setUpwd(String upwd) {
        this.upwd = upwd;
    }

    public String getUaccount() {
        return uaccount;
    }

    public void setUaccount(String uaccount) {
        this.uaccount = uaccount;
    }

    public String getUemail() {
        return uemail;
    }

    public void setUemail(String uemail) {
        this.uemail = uemail;
    }

    public String getSoftdel() {
        return softdel;
    }

    public void setSoftdel(String softdel) {
        this.softdel = softdel;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        User other = (User) that;
        return (this.getUid() == null ? other.getUid() == null : this.getUid().equals(other.getUid()))
            && (this.getUname() == null ? other.getUname() == null : this.getUname().equals(other.getUname()))
            && (this.getUpwd() == null ? other.getUpwd() == null : this.getUpwd().equals(other.getUpwd()))
            && (this.getUaccount() == null ? other.getUaccount() == null : this.getUaccount().equals(other.getUaccount()))
            && (this.getUemail() == null ? other.getUemail() == null : this.getUemail().equals(other.getUemail()))
            && (this.getSoftdel() == null ? other.getSoftdel() == null : this.getSoftdel().equals(other.getSoftdel()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUid() == null) ? 0 : getUid().hashCode());
        result = prime * result + ((getUname() == null) ? 0 : getUname().hashCode());
        result = prime * result + ((getUpwd() == null) ? 0 : getUpwd().hashCode());
        result = prime * result + ((getUaccount() == null) ? 0 : getUaccount().hashCode());
        result = prime * result + ((getUemail() == null) ? 0 : getUemail().hashCode());
        result = prime * result + ((getSoftdel() == null) ? 0 : getSoftdel().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", uid=").append(uid);
        sb.append(", uname=").append(uname);
        sb.append(", upwd=").append(upwd);
        sb.append(", uaccount=").append(uaccount);
        sb.append(", uemail=").append(uemail);
        sb.append(", softdel=").append(softdel);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}